import request from '@/plugins/axios'

export function fetchList(query) {
  return request({
    url: '/api/processMgr/getActReProcdefVoPage',
    method: 'get',
    params: query
  })
}


export function findConfig(id) {
    return request({
        url: '/api/flowTaskResult/toResultList/' + id,
        method: 'get',
    })
}

export function sameData(id) {
    return request({
        url:'/api/flowTaskConf/flowTaskConf/'+id,
        method:'get'
    })
}


export function addObj(obj) {
  return request({
    url: '/api/actreprocdef',
    method: 'post',
    data: obj
  })
}

export function getObj(id) {
  return request({
    url: '/api/actreprocdef/' + id,
    method: 'get'
  })
}

export function delObj(id) {
  return request({
    url: '/api/processMgr/delProcess/' + id,
    method: 'delete'
  })
}

export function delprocdefConfId(id) {
    return request({
        url:'/api/flowProcdefConf/'+id,
        method:'delete',
        params: id
    })

}

export function putObj(obj) {
  return request({
    url: '/api/actreprocdef',
    method: 'put',
    data: obj
  })
}


//导入用单独的方法
export function batchImport(query) {
    return request({
        url: '/api/processMgr/doDeployUpload/upload',
        method: 'post',
        data: query,
        config:{
            headers:{'Content-Type':'multipart/form-data'}
        }
    })
}
// 新增工作流程
export function addConfig(obj) {
    return request({
        url: '/api/flowTaskConf',
        method: 'post',
        data: obj,
        config:{
            headers:{'Content-Type':'application/json'}
        }
    })
}
//  工作流业务流程任务配置 删除
export function delConfig(id) {
    return request({
        url: '/api/flowTaskConf/' + id,
        method: 'delete'
    })
}

//  工作流业务流程任务配置 删除
export function delConfiguration(id) {
    return request({
        url: '/api/flowTaskResult/deleteTaskResult/' + id,
        method: 'delete'
    })
}
